<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html;charset=UTF-8"/>
    <title>Title</title>
</head>
<body>
    <div>
        <span th:text="${singlePerson.name}"></span>
    </div>

    <div th:if="${not #lists.isEmpty(people)}">
        <ul>
            <li th:each="person:${people}">
                <span th:text="${person.name}"></span>
                <span th:text="${person.age}"></span>
            </li>
        </ul>

    </div>

</body>
<script th:inline="javascript">
    var single = [{${singlePerson}}];
    console.log(single.name+"/"+single.age);
    function getName(){
        console.log(name);
    }
</script>
</html>